<?php
//检测PHP设置参数
function show($varName){
	switch($result = get_cfg_var($varName)){
		case 0:
			return '<font color="red">×</font>';
            break;
        case 1:
            return '<font color="green">√</font>';
            break;
        default:
            return $result;
            break;
        }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>欢迎页</title>

    <link rel="stylesheet" href="/public/admin/frame/layui/css/layui.css">
    <link rel="stylesheet" href="/public/admin/css/style.css">
    <link rel="icon" href="/public/admin/image/code.png">

</head>
<body>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>网站配置</legend>
</fieldset>

<table class="layui-table">
    <colgroup>
        <col width="150">
        <col width="150">
    </colgroup>
    <tbody>
    <tr>
        <td>网站标题</td>
        <td>博客社区</td>
    </tr>
    <tr>
        <td>网站logo</td>
        <td><img src="/public/admin/image/logo.png" style="width: 135px;height: 37px;"></td>
    </tr>
    <tr>
        <td>keywords</td>
        <td>Blog,博客，社区，讨论，论坛</td>
    </tr>
    <tr>
        <td>description</td>
        <td>博客讨论社区</td>
    </tr>
    <tr>
        <td>网站总注册人数</td>
        <td>100</td>
    </tr>
    <tr>
        <td>网站在线人数</td>
        <td>50</td>
    </tr>
    </tbody>
</table>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>服务器配置</legend>
</fieldset>

<table class="layui-table">
    <colgroup>
        <col width="50">
        <col width="150">
        <col width="50">
        <col width="150">
    </colgroup>
    <tbody>
    <tr>
        <td>服务器域名</td>
        <td colspan="3">
            <?php echo $_SERVER['SERVER_NAME'];?>
            (<?php if('/'==DIRECTORY_SEPARATOR){echo $_SERVER['SERVER_ADDR'];}else{echo @gethostbyname($_SERVER['SERVER_NAME']);} ?>)
        </td>
    </tr>
    <tr>
        <td>服务器标识</td>
        <td colspan="3"><?php echo @php_uname(); ?></td>
    </tr>
    <tr>
        <td>服务器操作系统</td>
        <td><?php $os = explode(" ", php_uname()); echo $os[0];?>
            &nbsp;内核版本：<?php if('/'==DIRECTORY_SEPARATOR){echo $os[2];}else{echo $os[1];} ?></td>
        <td>服务器解译引擎</td>
        <td><?php echo $_SERVER['SERVER_SOFTWARE'];?></td>
    </tr>
    <tr>
        <td>服务器语言</td>
        <td><?php echo getenv("HTTP_ACCEPT_LANGUAGE");?></td>
        <td>服务器端口</td>
        <td><?php echo $_SERVER['SERVER_PORT'];?></td>
    </tr>
    <tr>
        <td>服务器主机名</td>
        <td><?php if('/'==DIRECTORY_SEPARATOR ){echo $os[1];}else{echo $os[2];} ?></td>
        <td>绝对路径</td>
        <td><?php echo $_SERVER['DOCUMENT_ROOT']?str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']):str_replace('\\','/',dirname(__FILE__));?></td>
    </tr>
    </tbody>
</table>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>PHP相关参数</legend>
</fieldset>

<table class="layui-table">
    <colgroup>
        <col width="150">
        <col width="150">
    </colgroup>
    <tbody>
    <tr>
        <td>PHP版本</td>
        <td><?php echo PHP_VERSION;?></td>
    </tr>
    <tr>
        <td>上传文件最大限制</td>
        <td><?php echo show("upload_max_filesize");?></td>
    </tr>
    <tr>
        <td>脚本占用最大内存</td>
        <td><?php echo show("memory_limit");?></td>
    </tr>
    <tr>
        <td>POST提交最大限制</td>
        <td><?php echo show("post_max_size");?></td>
    </tr>
    </tbody>
</table>

<script type="text/javascript" src="/public/admin/frame/layui/layui.js"></script>
<script type="text/javascript">

</script>
</body>
</html>